<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>登录页面</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.1/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
        }
        .login-card {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 1rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
        }
        .social-login img {
            width: 32px;
            height: 32px;
        }
    </style>
</head>
<body>
<div class="container py-5">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-4">
            <div class="login-card p-4">
                <h2 class="text-center mb-4 text-primary">用户登录</h2>
                <form action="${pageContext.request.contextPath}/denglu/login" method="post" class="needs-validation" novalidate>
                    <div class="mb-3">
                        <label for="name" class="form-label">用户名</label>
                        <input type="text" class="form-control" id="name" name="name" required>
                        <div class="invalid-feedback">请输入用户名</div>
                    </div>
                    <div class="mb-3">
                        <label for="pass" class="form-label">密码</label>
                        <input type="password" class="form-control" id="pass" name="pass" required>
                        <div class="invalid-feedback">请输入密码</div>
                    </div>
                    <div class="mb-3 form-check">
                        <input type="checkbox" class="form-check-input" id="rememberMe">
                        <label class="form-check-label" for="rememberMe">记住我</label>
                    </div>
                    <button type="submit" class="btn btn-primary w-100 mb-3">立即登录</button>
                </form>
                <div class="mt-3 text-center">  
                    <div class="mt-2">
                        没有账号？<a href="${pageContext.request.contextPath}/qiantai/register" class="text-decoration-none">立即注册</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.3.1/js/bootstrap.bundle.min.js"></script>
<script>
    (function () {
        'use strict'
        var forms = document.querySelectorAll('.needs-validation')
        Array.prototype.slice.call(forms)
            .forEach(function (form) {
                form.addEventListener('submit', function (event) {
                    if (!form.checkValidity()) {
                        event.preventDefault()
                        event.stopPropagation()
                    }
                    form.classList.add('was-validated')
                }, false)
            })
    })()
</script>
</body>
</html>
